package L623;

import java.util.Arrays;
import java.util.HashMap;

/**
 * @program: javase
 * @description: 数组元素组成最小数
 * @author: luolidong
 * @create: 2021-06-27 09:34
 * @version: 1.0
 */
public class Offer45 {
    public String minNumber(int[] nums) {
        String[] strings=new String[nums.length];
        for (int i = 0; i < nums.length; i++) {
            strings[i]=nums[i]+"";
        }
        Arrays.sort(strings,(x,y)->(y+x).compareTo(x+y));
        String ans="";
        for(String s:strings){
            ans+=s;
        }
        return ans;
    }

    public static void main(String[] args) {
        HashMap<Object, Object> map = new HashMap<>();
        Object b = map.get("b");
        System.out.println(b);
    }
}
